<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="StyleSheet" type="text/css" href="{%$templates%}/admin.css">
{%formtool_init src="$templates/js/formtool.js"%}
</head>
<body marginheight='0' topmargin='0'>
<table border='0' cellpadding='0' cellspacing='1' width='100%' class="text">
<tr bgcolor='#f5f5f5'>
<td height='40px' style='padding-left:20px; padding-rigth: 20px' valign='middle' align='center' class='darkgrey'>
<a href='advertisement.php?a=1' class='lmid' target='_self'>Добавить Объявление</a>
</td>
<td align='right' valign='middle'>
<form action='advertisement.php' method='POST' name=''>
{%if $tree neq false%}
{%assign var="minus" value=0%}
<select onchange="submit();" name="cat">
{%section loop=$path name=p%}
{%assign var="minus" value=$smarty.section.p.iteration+1%}
<option value="{%$path[p].id%}"{%if $path[p].id eq $category%} selected{%/if%}>
{%if $smarty.section.p.first eq false%}{%""|indent:$minus:"&nbsp;&nbsp;"%}+-- {%/if%}{%$path[p].title%}
</option>
{%sectionelse%}
<option value="">Объявления</option>
{%/section%}
{%section loop=$tree name=t start=1%}
<option value="{%$tree[t].id%}"{%if $tree[t].id eq $category%} selected{%/if%}>
{%""|indent:$minus+1:"&nbsp;&nbsp;"%}+-- {%$tree[t].title%}
</option>
{%/section%}
</select>
{%else%}
<span class='warn'>Не создано дерево категорий для каталога</span>
{%/if%}
</form>
</td>
</tr>

<tr>
<td align='center' valign='top' style='padding-top: 5px' colspan="2">

{%if $vars neq false%}
<form action='advertisement.php' method='POST'>
<table width='100%' border='0' cellpadding='2' cellspacing='1' class='text'>
<tr bgcolor='#cccccc'>
<th>N:</th>
<th>User:</th>
<th>Заголовок:</th>
<th>Публикация:</th>
<th>До:</th>
<th>Контакт:</th>
<th>Категория:</th>
<th>Текст:</th>
<th>Активность:</th>
<th>Удалить:</th>
</tr>
{%section name=i loop=$vars%}
<tr bgcolor='{%cycle values="#f0f0f0,#e0e0e0"%}'>
<td align='center' valign="middle">{%$smarty.section.i.iteration+$paginate.first-1%}
{%if $vars[i].file neq false%}<img src='{%$templates%}/img/img.png' border='0' alt='Photo'>{%/if%}
</td>
<td align="left" valign="middle">&nbsp; {%$vars[i].login%}</td>
<td align='left' valign="middle">&nbsp; <a href='advertisement.php?a=2&id={%$vars[i].id%}' class="lmid">{%$vars[i].title%}</a></td>
<td align='left' valign="middle">&nbsp; {%$vars[i].dat|date_format:"%d.%m.%y"%}</td>
<td align='left' valign="middle">&nbsp; {%$vars[i].valid|date_format:"%d.%m.%y"%}</td>
<td align='left' valign="middle">&nbsp; {%$vars[i].contacts|nl2br%}</td>
<td align="left" valign="middle">&nbsp; {%$vars[i].category%}</td>
<td align="left" valign="middle">{%$vars[i].content|nl2br%}</td>
<td align='center' valign="middle">
{%if $vars[i].status eq 1%}
<a href='advertisement.php?a=3&id={%$vars[i].id%}{%if $category neq false%}&cat={%$category%}{%/if%}'><img src='{%$templates%}/img/on.png' border='0' alt='Turn OFF'></a>
{%else%}
<a href='advertisement.php?a=4&id={%$vars[i].id%}{%if $category neq false%}&cat={%$category%}{%/if%}'><img src='{%$templates%}/img/off.png' border='0' alt='Turn ON'></a>
{%/if%}
</td>
<td align='center' valign="middle"><input type='checkbox' value='{%$vars[i].id%}' name='dele[]'></td>
</tr>
{%/section%}
<tr></table>
<div align="right" style="margin:10">
{%formtool_checkall name="dele[]" checkall_text="Выбрать все" uncheckall_text="Снять выделение"%}
</div>
<div align="right" style="margin:10">
<input type='submit' name='submit' value='&nbsp;Удалить&nbsp;' onclick='window.confirm("Вы уверены?\nОтмеченные вами записи будут удалены!")'>
</div>

<div style="float:left">
Записей {%$paginate.first id=$pid%}-{%$paginate.last id=$pid%} из {%$paginate.total id=$pid%}
</div>
<div style="float:right;">
{%paginate_prev id=$pid extra="class='lmid'"%} {%paginate_middle id=$pid extra="class='lmid'"%} {%paginate_next id=$pid extra="class='lmid'"%}
</div>

</form>
{%else%}
<font color='red'>Нет никаких данных чтобы отобразить</font>
{%/if%}

</td></tr>
</tr>
</table>

</body>
</html>